package com.demo.mantis.service;

import javax.inject.Singleton;

@Singleton
public class CalculatorServiceImpl implements CalculatorService {

    @Override
    public float plus(float x, float y) {
        return x + y;
    }

    @Override
    public float subtract(float x, float y) {
        return x - y;
    }

    @Override
    public float multiply(float x, float y) {
        return x * y;
    }

    @Override
    public float divide(float x, float y) {
        if (y == 0f) {
            return Float.NEGATIVE_INFINITY;

        }else{
            return x/y;
        }
    }
}
